package com.ww.springboot.boot.util;

import cn.hutool.core.math.MathUtil;
import com.google.common.collect.Lists;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2024-01-10 14:52
 */
public class MathUtilCollection {

    public static void main(String[] args) {

        System.out.println(MathUtil.arrangementCount(5));

        List<String> list = IntStream.range(0, 10).boxed().map(i -> String.valueOf(i)).collect(Collectors.toList());
        //列表切割
        System.out.println(Lists.partition(list, 3));
        //翻转
        System.out.println(Lists.reverse(list));
        //笛卡尔积
        System.out.println(Lists.cartesianProduct(list, list, list));
    }
}
